package com.vencent.spring.handle;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import com.vencent.spring.exception.StudentsNotFountException;

/**
 * all exception in there to get helping
 * @ControllerAdvice 's inside including @Component 
 * It's effect to make 
 * @ExceptionHandler 
 * @InitBinder
 * @ModelAttribute
 * for every Controller's method that be signed.
 * @author 1d
 *
 */
@ControllerAdvice
public class ExceptionHandle {

	@ExceptionHandler(StudentsNotFountException.class)
	public String handleDuplicatStudent(){
		return "error/students";
	}
}
